home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 048 (1988-02-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 048 (1988-02-15)(Ossowski, Stefan)(DE)(PD).adf / Mandel / source / mandel.h < prev    next >
C/C++ Source or Header  |  1988-01-23  |  6KB  |  193 lines

  1. /* :ts=4
  2.  * Common DEFINEs and external declarations for the
  3.  * Mandelbrot Construction Set...
  4.  */
  5.  
  6. #define MYFRONTPEN    2         /* Black */
  7.  
  8. /* Menus */
  9. #define CPRMENU        0        /* Copyright Menu */
  10. #define PRJMENU        1        /* Poject Menu */
  11. #define OPTMENU        2        /* Option Menu */
  12. #define FUNMENU        3        /* Functions Menu */
  13.  
  14. /* Menu items */
  15. #define PRJNEW         0        /* Project Menu: New */
  16. #define PRJOPN         1        /*               Open */
  17. #define PRJSVE         2        /*               Save */
  18. #define PRJSVA         3        /*               Save As */
  19. #define PRJQUI         4        /*               Quit */
  20.  
  21. #define OPTCOL         0        /* Option Menu: Colors */
  22. #define OPTRES         1        /*              Resolution */
  23. #define OPTPAR         2        /*              Parameters */
  24.  
  25. #define FUN1        0        /* Functions Menu: Z^2-C */
  26. #define FUN2        1        /*                 ZC1MinZ */
  27. #define FUN3        2        /*                 Z3PlusZCMin1MinC */
  28.  
  29. /* subitems */
  30. #define PNABS          0        /* Project New: Absolute */
  31. #define PNENL          1        /*              Enlarge */
  32. #define PNRED          2        /*              Reduce */
  33. #define PNSHF          3        /*              Shift */
  34.  
  35. #define OCSEL         0        /* Opt Color: Select */
  36. #define OCMOD         1        /*            Modulo */
  37. #define OCRAN         2        /*            Ranges */
  38. #define OCPAL         3        /*            Palette */
  39.  
  40. #define ORNRM         0        /* Opt Resl: Normal */
  41. #define OR12          1        /*           1/2 */
  42. #define OR13          2        /*           1/3 */
  43. #define OR14          3        /*           1/4 */
  44. #define ORFIL         4        /*           Fill In */
  45. #define ORHI          5        /*           HiRes */
  46. #define ORILC         6        /*           Interlace */
  47. #define ORBCK         7        /*           Borderless */
  48.  
  49. #define    POSGADGETID    10        /* For Positive Gadget */
  50. #define NEGGADGETID    11        /* For Negative Gadget */
  51.  
  52. #define    FNAME_SIZE    32L        /* Filename size */
  53. #define DNAME_SIZE    66L        /* Directoryname size */
  54.  
  55. #define MAXDEPTH    512        /* Maximum maximum depth */
  56. #define BMDEPTH        5        /* Depth of our bitmap */
  57. #define MAXCOL (1<<BMDEPTH)    /* Maximum number of colors */
  58.  
  59. #define NOTFRAMING    0        /* We are not framing */
  60. #define NOPOINT        1        /* We have no points of a frame */
  61. #define POINT1        2        /* We have 1 point of a frame */
  62. #define CENTERFRAMING 3        /* We have a center and are busy with a corner */
  63. #define    FLASHING    4        /* We are still flashing the frame */
  64.  
  65. #define MODULO        0        /* Pen assignment to the depths */
  66. #define RANGES        1
  67. #define SELECT        2
  68.  
  69. #define MAND        ((ULONG)'M'<<24 | (ULONG)'A'<<16 | 'N'<<8 | 'D')
  70.  
  71.  
  72. /* Let's try to make `goto' a little more structured... */
  73.  
  74. #define skipto        goto
  75. #define backto        goto
  76.  
  77.  
  78. /* Type definitions */
  79.  
  80. typedef short bool;
  81. struct BitMapHeader
  82. {
  83.     UWORD w, h;
  84.     UWORD x, y;
  85.     UBYTE nPlanes;
  86.     UBYTE masking;
  87.     UBYTE compression;
  88.     UBYTE pad1;
  89.     UWORD transparentColor;
  90.     UBYTE xAspect, yAspect;
  91.     WORD pageWidth, pageHeight;
  92. };
  93.  
  94. /*ILBM_info is the structure read_iff returns, and is hopefully all
  95.   you need to deal with out of the iff reader routines below*/
  96. struct ILBM_info
  97. {
  98.     struct BitMapHeader header;
  99.     UBYTE cmap[MAXCOL*3];    /*say hey aztec don't like odd length structures*/
  100.     struct BitMap bitmap;
  101. };
  102.  
  103. struct Mand
  104. {
  105.     ULONG    MandID;                /* 'MAND' */
  106.     LONG    Size;                /* sizeof(struct Mand) */
  107.     WORD    MaxDepth;            /* Maximum iteration count */
  108.     WORD    RangeWidth;
  109.     BYTE    RainDist;            /* From the palette Rainbow mode */
  110.     BYTE    RainRMax;            /* From the palette Rainbow mode */
  111.     BYTE    RainGMax;            /* From the palette Rainbow mode */
  112.     BYTE    RainBMax;            /* From the palette Rainbow mode */
  113.     BYTE    Coords[4 * 14];        /* Ascii representation */
  114. };
  115.  
  116. struct BorderInfo
  117. {
  118.     BYTE    SizeX, SizeY;
  119.     BYTE    MoveX, MoveY;
  120. };
  121.  
  122. /* Some Macros */
  123.  
  124. #define MENU(menu,item,subitem)\
  125.         (LONG)(SHIFTMENU(menu)|SHIFTITEM(item)|SHIFTSUB(subitem))
  126.  
  127. /* External declarations */
  128.  
  129. #include <functions.h>
  130. extern long GetScreenData();
  131. /*
  132. extern struct Screen *OpenScreen();
  133. extern struct Window *OpenWindow();
  134. extern struct IntuiMessage *GetMsg();
  135. extern struct Library *OpenLibrary();
  136. extern struct MenuItem *ItemAddress();
  137. extern long AutoRequest(), DisplayAlert(), Request(), MoveLayer(),
  138.             SizeLayer();
  139. extern void SetAPen(), WritePixel(), WindowLimits(), EndRequest();
  140. */
  141.  
  142.  
  143. /* Forward POINTER declarations */
  144.  
  145. extern struct Screen *MandelScreen;
  146. extern struct Window *MainWindow;
  147. extern struct IntuiMessage *message;
  148. extern void (*WritePixelDepth)();
  149.  
  150.  
  151. /* Forward STRUCT declarations */
  152.  
  153. extern struct Menu MandelMenu[];
  154. extern struct NewScreen MandelNScreen;
  155. extern struct NewWindow MainNWindow;
  156. extern struct TextAttr Topaz60, Topaz80;
  157. extern struct IntuiText PositiveText, NegativeText;
  158. extern struct Gadget PositiveGadget, NegativeGadget;
  159. extern struct BorderInfo borderinfo;
  160.  
  161.  
  162. /* Forward `SIMPLE' declarations */
  163.  
  164. extern int NumColors, MaxDepth, PixelStep, RangeWidth;
  165. extern unsigned PenTableMode;
  166. extern unsigned short FrameX1, FrameX2, FrameY1, FrameY2;
  167. extern short MouseStatus;
  168. extern bool finished, StillDrawing, Saved, NameValid;
  169. extern double LeftEdge, RightEdge, TopEdge, BottomEdge, CXStep, CYStep;
  170. extern UBYTE PenTable[MAXDEPTH];
  171.  
  172. extern SHORT RainbowDistance, RainbowRMax, RainbowGMax, RainbowBMax;
  173.  
  174. /* Forward FUNCTION declarations */
  175.  
  176. extern bool InitDisplay(), Sure(), CleanupDisplay(), InterpretMAND(),
  177.             DoBorderless();
  178. extern int WaitMyRequest(), write_iff();
  179. extern float Ratio();
  180. extern char *get_fname();
  181. extern struct ILBM_info *read_iff();
  182. extern struct Window *MyRequest();
  183.  
  184. extern void MyExit(), GotMenu(), UndoBorderless(), CprMenu(), PrjMenu(),
  185.             EdtMenu(), OptMenu(), FunMenu(), UnImpl(), DrawPicture(),
  186.             EndMyRequest(), CloseWindowSafely(), get_ea_cmap(),
  187.             put_ea_cmap(), free_planes(), RectDraw(), CrossDraw(),
  188.             CheckMouse(), InitPenTable(), StopFraming(),
  189.             EnableSystemGadgets(), DisableSystemGadgets(), Parameters(),
  190.             Palette(), MakeMAND(), StopDrawing(), CalcCSteps(),
  191.             ZQuadMinC(), ZC1MinZ(), Z3PlusZCMin1MinC(), SelectMenu(),
  192.             SuspendDrawing(), ResumeDrawing();
  193.